home *** CD-ROM | disk | FTP | other *** search
- new nroot sammler/avoidcollision
- sel sammler/avoidcollision
-
- # --------------------------------------------------------------------
- # Sammler, der kuemmert sich eigentlich nur um grosse Sachen, deswegen
- # lassen wir die tests auch einfach.
- # --------------------------------------------------------------------
- new ncommandlist avoidleft
- avoidleft.setadjusttype horimaneuver
- avoidleft.settestcommand sacleft_test
- avoidleft.addcommand true -100 0 0 false 0 0 0 nothing 2.0
-
- proc sacleft_test {} {
-
- if {[.getavoidcollisiondirection] == "left"} {
- return 1.0
- } else {
- return 0.0
- }
- }
-
- new ncommandlist avoidright
- avoidright.setadjusttype horimaneuver
- avoidright.settestcommand sacright_test
- avoidright.addcommand true 100 0 0 false 0 0 0 nothing 2.0
-
- proc sacright_test {} {
-
- if {[.getavoidcollisiondirection] == "right"} {
- return 1.0
- } else {
- return 0.0
- }
- }
-
- new ncommandlist avoidup
- avoidup.setadjusttype horimaneuver
- avoidup.settestcommand sacup_test
- avoidup.addcommand true 0 100 -50 false 0 0 0 nothing 2.0
-
- proc sacup_test {} {
-
- if {[.getavoidcollisiondirection] == "up"} {
- return 1.0
- } else {
- return 0.0
- }
- }
-
- new ncommandlist avoiddown
- avoiddown.setadjusttype horimaneuver
- avoiddown.settestcommand sacdown_test
- avoiddown.addcommand true 0 -100 -50 false 0 0 0 nothing 2.0
-
- proc sacdown_test {} {
-
- if {[.getavoidcollisiondirection] == "down"} {
- return 1.0
- } else {
- return 0.0
- }
- }
-
-
- #--------------------------------------------------------------
- # Ausnahmebehandlung: Anscheinend passiert folgende Situation:
- # eine erwartete Kollision bringt uns in den zustand, aber dann
- # wurde das Modul schon wieder getriggert ohne eine Kollision
- # zu melden. Dafuer machen wir noch ein kurzes Script.
- # Ausserdem, und das wird der hauptgrund sein, wird zwar der
- # Zustand nach abarbeitung der ersten Liste abgebrochen, aber
- # das Modul such noch eine weitere Liste. Also bieten wir eine,
- # auch wenn diese im naechsten Frame abgeschalten wird.
- #--------------------------------------------------------------
- new ncommandlist avoidnothing
- avoidnothing.setadjusttype horimaneuver
- avoidnothing.settestcommand aacnothing_test
- avoidnothing.addcommand true 0 0 -100 false 0 0 0 nothing 0.2
-
- proc aacnothing_test {} {
-
- if {[.getavoidcollisionkind] == "nothing"} {
- return 1.0
- } else {
- return 0.0
- }
- }
-
- sel ..
- sel ..
-
-